package org.light.generator;

import java.util.ArrayList;
import java.util.List;

import org.light.core.Writeable;
import org.light.domain.Statement;
import org.light.domain.Util;
import org.light.utils.WriteableUtil;

public class CodeGoGenerator {
	protected String fileName = "code.go";

	public String generateString() {
		List<Writeable> sList = new ArrayList<Writeable>();
		sList.add(new Statement(1000L,0,"package errno"));
		sList.add(new Statement(2000L,0,""));
		sList.add(new Statement(3000L,0,"var ("));
		sList.add(new Statement(4000L,1,"// Common errors"));
		sList.add(new Statement(5000L,1,"OK                  = &Errno{Code: 0, Message: \"OK\"}"));
		sList.add(new Statement(6000L,1,"InternalServerError = &Errno{Code: 10001, Message: \"Internal server error\"}"));
		sList.add(new Statement(7000L,1,"ErrBind             = &Errno{Code: 10002, Message: \"Error occurred while binding the request body to the struct.\"}"));
		sList.add(new Statement(8000L,0,""));
		sList.add(new Statement(9000L,1,"ErrValidation = &Errno{Code: 20001, Message: \"Validation failed.\"}"));
		sList.add(new Statement(10000L,1,"ErrDatabase   = &Errno{Code: 20002, Message: \"Database error.\"}"));
		sList.add(new Statement(11000L,0,""));
		sList.add(new Statement(12000L,1,"// user errors"));
		sList.add(new Statement(13000L,1,"ErrUserNotFound      = &Errno{Code: 20101, Message: \"The user was not found.\"}"));
		sList.add(new Statement(14000L,1,"ErrPasswordIncorrect = &Errno{Code: 20102, Message: \"The password was incorrect.\"}"));
		sList.add(new Statement(15000L,0,")"));
		return WriteableUtil.merge(sList).getContent();
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

}
